<template>
  <div class="tree">
      <div v-for="(item,index) in ShopList" :key="index">
        <p>{{item.title}}</p>
        <p>{{item.context}}</p>
        <p>{{item.money}}</p>
      </div>
  </div>
</template>

<script>
export default {
  data(){
    return {
      shoplist:[],
      id:null
    }
  },
  created(){
    this.ShopList()
  },
  methods:{
    ShopList(){
      this.$api.shoplist().then(res=>{
          this.id=res.data.data.length
          return new Promise((resolve,reject)=>{
            if(res.code===1){
              this.$api.shopDeil(this.id).then(res=>{
               this.shoplist.push(res.data.data[0])
               console.log(this.shoplist.push(res.data.data[0]));
               
              })
            }
          })
      })
      
    },
    addShoplist(id){
      console.log(id)
    this.$api.shopDeil(id).then(res=>{
        console.log(123);
        
      })
    }
  }
}
</script>

<style>

</style>